home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Demos
/
Bowers Development
/
AppMaker 2.0b5
/
Examples
/
TCL
/
AMReminder
/
zAMReminderDoc.cp
< prev
next >
Wrap
Text File
|
1996-03-19
|
3KB
|
154 lines
/* zAMReminderDoc.cp -- document methods */
/* Created 01/01/95 12:01 PM by AppMaker */
/* We recommend that you not modify this module and instead modify */
/* its subclass, AMReminderDoc. The 'z' prefix on this module marks */
/* a module which is likely to be regenerated by AppMaker after you */
/* make changes to the user interface. The modules without the 'z' */
/* prefix will not be regenerated by AppMaker unless you delete them. */
/* Using a separate subclass to override the AppMaker-generated code */
/* lets you regenerate code without losing your hand-coded changes. */
#include <Commands.h>
#include <Global.h>
#include <CApplication.h>
#include <CBartender.h>
#include <CDataFile.h>
#include <CDesktop.h>
#include <CError.h>
#include <CWindow.h>
#include <TBUtilities.h>
#include "CmdCodes.h"
#include "AMReminderData.h"
#include "Add.h"
#include "Add.h"
#include "MainWindow.h"
#include "zAMReminderDoc.h"
extern CApplication *gApplication; /* The application */
extern CBartender *gBartender; /* The menu handling object */
extern CError *gError; /* The error handling object */
/*----------*/
void ZAMReminderDoc::IAMReminderDoc (CApplication *aSupervisor,
Boolean printable)
{
inherited::IDocument (aSupervisor, printable);
itsData = NULL;
} /* IAMReminderDoc */
/*----------*/
void ZAMReminderDoc::Dispose (void)
{
ForgetObject (itsData);
itsFile = NULL; // was disposed by ForgetObject (itsData)
ForgetObject (this);
} /* Dispose */
/*----------*/
void ZAMReminderDoc::NewFile (void)
{
itsData = new CAMReminderData;
itsData->IAMReminderData (this);
BuildWindows ();
if (itsWindow != NULL) {
itsWindow->Select ();
}
} /* NewFile */
/*----------*/
void ZAMReminderDoc::OpenFile (SFReply *macSFReply)
{
Str63 theName;
itsData = new CAMReminderData;
itsData->IAMReminderData (this);
itsData->SFSpecify (macSFReply);
itsData->OpenData (fsRdWrPerm);
itsFile = itsData;
BuildWindows ();
itsFile->GetName (theName);
if (itsWindow != NULL) {
itsWindow->SetTitle (theName);
itsWindow->Select ();
}
} /* OpenFile */
/*----------*/
void ZAMReminderDoc::BuildWindows (void)
{
CWindow *mainWindow;
mainWindow = new CMainWindow;
itsWindow = mainWindow;
((CMainWindow *)mainWindow)->IMainWindow (this, itsData);
itsMainPane = ((CMainWindow *)mainWindow)->itsMainPane;
} /* BuildWindows */
/*----------*/
Boolean ZAMReminderDoc::DoSave (void)
{
if (itsFile == NULL) {
return (DoSaveFileAs ());
} else {
if (itsData->Save ()) {
dirty = FALSE;
return (TRUE);
} else {
return (FALSE);
}
}
} /* DoSave */
/*----------*/
Boolean ZAMReminderDoc::DoSaveAs (SFReply *macSFReply)
{
if (itsData->SaveAs (macSFReply)) {
itsFile = itsData;
if (itsWindow != NULL) {
itsWindow->SetTitle (macSFReply->fName);
}
dirty = FALSE;
return (TRUE);
} else {
return (FALSE);
}
} /* DoSaveAs */
/*----------*/
void ZAMReminderDoc::DoRevert (void)
{
itsData->Revert ();
dirty = FALSE;
} /* DoRevert */
//----------
void ZAMReminderDoc::DoAddReminder ()
{
}
//----------
void ZAMReminderDoc::DoEditReminder ()
{
}
//----------
void ZAMReminderDoc::DoDeleteReminder ()
{
}
/* zAMReminderDoc.cp */